import request from '@/utils/request'

export function getTicketByPage(data) {
  return request({
    url: '/ticket',
    params: { ...data }
  })
}

export function getTicketById(id) {
  return request({
    url: `/ticket/${id}`,
  })
}

export function addTicket(data) {
  return request({
    url: '/ticket',
    method: 'post',
    data: data
  })
}

export function updateTicketById(data) {
  return request({
    url: `/ticket`,
    method: 'put',
    data: data
  })
}

export function deleteTicket(id) {
  return request({
    url: `/ticket/${id}`,
    method: 'delete',
  })
}

export function batchDeleteTicket(idList) {
  return request({
    url: `/ticket/batchDelete`,
    method: 'post',
    data: idList
  })
}
